**************************
* Replication Do-file   **
* LAPS-Colombpeaceatts  **
* Muñoz and Pachón      **
**************************

use "C:\Users\mmuno\Dropbox\Manuela-Mónica\Tesis Manuela\LAPS\Final Submission\Results and Data\LAPS-colombpeaceatts.dta",clear

*** Tables and Figures: Manuscript***

*** Table 1***

tab1 genero estrato educacion edad

*** Table 2 PCA***

global list4 catolica evangelico escala_pol Santos Zuluaga conf_justicia  conf_presidente conf_fuerzas just_viol vene_demo
global ncomp 7
pca $list4 , comp($ncomp) blanks  (.3)

*** Table 3. LPM***
global controls genero edad_30_50 menor_secundaria estrato_3_menos 

reg voto1 c.f1_all c.f2_all c.f3_all $controls, robust
outreg2 using reg_output3.xls, dec (4) label 
fitstat
reg voto1 c.f1_all c.f2_all c.f3_all i.date $controls, robust
outreg2 using reg_output3.xls, dec (4) label 
fitstat
reg voto1 c.f1_all c.f2_all c.f3_all i.encuesta_internet $controls, robust
outreg2 using reg_output3.xls, dec (4) label 
fitstat

*** Table 4. OLS***
global controls genero edad_30_50 menor_secundaria estrato_3_menos 

*Curules FARC(all components)*

reg curules_farc_std c.f1_all c.f2_all c.f3_all $controls, robust
fitstat
outreg2 using reg_output5.xls, label 

*Impunidad FARC(all components)*
reg impunidad_farc_std c.f1_all c.f2_all c.f3_all $controls, robust
fitstat
outreg2 using reg_output5.xls, dec (4) label

*Recursos FARC*

reg recursos_farc_std c.f1_all c.f2_all c.f3_all $controls, robust
fitstat
outreg2 using reg_output5.xls, dec (4) label

*Modificacion de los acuerdos*

reg modif_acuerdos_std c.f1_all c.f2_all c.f3_all $controls, robust
fitstat
outreg2 using reg_output5.xls, dec (4) label

*Desmovilizacion de las FARC*

reg desmov_farc_std c.f1_all c.f2_all c.f3_all $controls, robust
fitstat
outreg2 using reg_output5.xls, dec (4) label

*Mas violencia si gana el no*
reg no_violencia_std c.f1_all c.f2_all c.f3_all $controls, robust
fitstat
outreg2 using reg_output5.xls, dec (4) label

***Table 5. LAPOP PCA***
use "C:\Users\mmuno\Dropbox\Manuela-Mónica\Tesis Manuela\LAPS\Final Submission\Results and Data\LAPOP Colombia 2016.dta",clear
global LAPOP_c catolica evangelico escala_pol Santos Zuluaga conf_justicia conf_ejecutivo conf_fuerzas just_viol 
pca $LAPOP_c ,comp($ncomp) blanks (.3)


*** Figure 1. K-density plot***
tw (kdensity f1_all if voto1==1) (kdensity f1_all if voto1==0), name(a,replace)nodraw
tw (kdensity f2_all if voto1==1) (kdensity f2_all if voto1==0), name(b,replace)nodraw
tw (kdensity f3_all if voto1==1) (kdensity f3_all if voto1==0), name(c,replace)nodraw

graph combine a b c

*** Tables and Figures: Appendix***

*** Figure II-1*** Scree Plot
global list4 catolica evangelico escala_pol Santos Zuluaga conf_justicia  conf_presidente conf_fuerzas just_viol vene_demo
global ncomp 7
pca $list4 , comp($ncomp) blanks  (.3)
screeplot, yline(1)

***Table II-1. Full PCA***
global list4 catolica evangelico escala_pol Santos Zuluaga conf_justicia  conf_presidente conf_fuerzas just_viol vene_demo
pca $list4 , comp($ncomp)

***Tables II-2 II-3. PCA face-to-face and online***
global list4 catolica evangelico escala_pol Santos Zuluaga conf_justicia  conf_presidente conf_fuerzas just_viol vene_demo
pca $list4 if encuesta_internet==0  , comp($ncomp) blanks  (.3)
pca $list4 if encuesta_internet==1  , comp($ncomp) blanks  (.3)

***Table II-4. LAPOP PCA presidential approval***
global LAPOP_c2 catolica evangelico escala_pol Santos Zuluaga conf_justicia conf_ejecutivo conf_fuerzas just_viol aproba_presidente
pca $LAPOP_c2 ,comp($ncomp) blanks (.3)

*** Table III-1. Logit***
global controls genero edad_30_50 menor_secundaria estrato_3_menos 
logit voto1 c.f1_all c.f2_all c.f3_all 
margins, dydx(*) post
outreg2 using output1.xls, label
logit voto1 c.f1_all c.f2_all c.f3_all $controls
fitstat
margins, dydx(*) post
outreg2 using output1.xls, dec(4)  label
logit voto1 c.f1_all c.f2_all c.f3_all i.date $controls
fitstat
margins, dydx(*) post
outreg2 using output1.xls, dec(4)  label
logit voto1 c.f1_all c.f2_all c.f3_all i.encuesta_internet $controls
fitstat
margins, dydx(*) post
outreg2 using output1.xls, dec(4) label

***Table III-2. LAPOP Regressions***
use "C:\Users\mmuno\Dropbox\Manuela-Mónica\Tesis Manuela\LAPS\Final Submission\Results and Data\LAPOP Colombia 2016.dta",clear

global controls sexo edad educacion urbano q10new

reg voto2 c.f1_all c.f2_all c.f3_all, robust
fitstat
outreg2 using output2.xls, label 
reg voto2 c.f1_all c.f2_all c.f3_all $controls, robust
fitstat
outreg2 using output2.xls, label 

logit voto2 c.f1_all c.f2_all c.f3_all 
fitstat
margins, dydx(*) post
outreg2 using output2.xls, label
logit voto2 c.f1_all c.f2_all c.f3_all $controls
fitstat
margins, dydx(*) post
outreg2 using output2.xls, label
